﻿<shared:UserControlBase x:Class="Bymed.SpineScan.WPF.CustomizedUserControl.CustomizedSingleTestResultHistoryDataReportContentUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:shared="clr-namespace:Bymed.SpineScan.WPF.Shared"
             xmlns:userControl="clr-namespace:Bymed.SpineScan.WPF.CustomizedUserControl"
             mc:Ignorable="d" 
             d:DesignHeight="1100" d:DesignWidth="793">
    <Grid Height="1100" Margin="10,12,0,0">
        <Grid.RowDefinitions>
            <!-- Report Header -->
            <RowDefinition Height="Auto" />
            <!-- Selected Test Item Name -->
            <RowDefinition Height="Auto" />
            <!-- Test Result List -->
            <RowDefinition />
            <!-- Footer -->
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <userControl:TestResultReportHeaderUserControl Margin="0,10,0,0" DataContext="{Binding}" />
        <TextBlock Grid.Row="1" HorizontalAlignment="Center" Margin="0,20,0,10" FontSize="26" Foreground="Black"
                   Text="{Binding SelectedTestItem.TestItemTitle}" Style="{StaticResource TestReportTitleTextBlock}" />
        <DataGrid Grid.Row="2" Margin="10" Width="750" ItemsSource="{Binding HistoryAnalysisChartSource}">
            <DataGrid.Columns>
                <DataGridTextColumn Width="170" Header="项目名称" Binding="{Binding TestItemTitle}" />
                <DataGridTextColumn Width="170" Header="项目类型" Binding="{Binding TestItemTypeDescription}" />
                <DataGridTextColumn Width="300" Header="项目结果" Binding="{Binding FormattedTestResult}" />
            </DataGrid.Columns>
        </DataGrid>
        <Grid Grid.Row="3" TextBlock.FontSize="13" Width="750" Margin="10,5,10,4" VerticalAlignment="Bottom">
            <Grid.RowDefinitions>
                <RowDefinition Height="35" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <TextBlock>
                <TextBlock.Style>
                    <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource TestReportTextBlock}">
                        <Setter Property="Text" Value="{Binding HistoryAnalysisChartSource[0].TestDateDisplay, StringFormat={}最后测试日期：{0}}" />
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding HistoryAnalysisChartSource.Count}" Value="0">
                                <Setter Property="Text" Value="无历史测试日期" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </TextBlock.Style>
            </TextBlock>
            <TextBlock Text="操作员签字：" Margin="0,0,120,0" HorizontalAlignment="Right" TextWrapping="Wrap" Style="{StaticResource TestReportTextBlock}" />
            <TextBlock Grid.Row="1" Text="本测量结果仅供临床医生参考，不作为诊断报告。" HorizontalAlignment="Right" Style="{StaticResource TestReportTextBlock}" />
        </Grid>
    </Grid>
</shared:UserControlBase>
